#include <iostream>
#include <string>
using namespace std;

class AbstractCalculator {
public:
    int num1;
    int num2;
    virtual int getResult() = 0;
};

class AddCalculator : public AbstractCalculator {
public:
    int getResult() {
        return num1 + num2;
    }
};

class SubCalculator : public AbstractCalculator {
public:
    int getResult() {
        return num1 - num2;
    }
};

int main() {

    AbstractCalculator *abc = new AddCalculator;
    abc->num1 = 10;
    abc->num2 = 67;
    cout<<abc->getResult()<<endl;
    delete(abc);

    abc = new SubCalculator;
    abc->num1 = 10;
    abc->num2 = 67;
    cout<<abc->getResult()<<endl;
    delete(abc);

    return 0;
}